import request from '@/utils/request'

export function dataApi(params) {
  return request({
    url: '/api/merchclass/data',
    method: 'get',
    params
  })
}

/**
 * 新增
 * @param {*} data
 */
export function addApi(data) {
  return request({
    url: '/api/merchclass',
    method: 'post',
    data
  })
}

/**
 * 修改
 * @param {*} data
 */
export function editApi(data) {
  return request({
    url: '/api/merchclass',
    method: 'put',
    data
  })
}

/**
 * 根据主键查询
 * @param {*} id
 */
export function findByIdApi(id) {
  return request({
    url: '/api/merchclass/' + id,
    method: 'get'
  })
}

/** 删除
 * @param {Object} ids 集合
 */
export function deleteByIdApi(ids) {
  return request({
    url: '/api/merchclass?ids=' + ids,
    method: 'delete'
  })
}

/**
 * 得到商家的分类列表信息
 */
export function merchandiseCategoryApi() {
  return request({
    url: '/api/merchclass/merchantId',
    method: 'get'
  })
}
